{% extends "base.html" %}
{% load satchmo.thumbnail %}
{% load satchmo.custom_filter %}
{% block title %} {{shop_name}} {% endblock %}

{% block navbar %}
Home
{% endblock %}

{% block content %}
Welcome to the shop. 


{% if all_items_list %}
    <h4>Featured Items</h4>
    {% for item in all_items_list %} 
            <div class = "productImage">    
           {% if item.main_image %}
              <center>
              <a href="{{ item.get_absolute_url }}"><img src="{{media_url}}{{ item.main_image.get_picture_url|thumbnail:"width=85" }}" width="85" /> </a>
              </center>
           {% endif %}     
            <p><a href="{{ item.get_absolute_url }}">{{ item.verbose_name }}</a></p>
        </div>
    {% endfor %}
{% endif %}

    {% if is_paginated %}
    <div id = "pagination">
    <ul>
        {% if has_previous %}
            <li> <a href="{{shop_base}}/?page={{previous}}">Prev</a></li>
        {% else %}
            <li> Prev </li>
        {% endif %}
        {% for page_number in pages|template_range %}
            {% ifequal page_number page %}
                <li class="currentpage">{{page_number}}</li>
            {% else %}
                <li> <a href="{{shop_base}}/?page={{page_number}}">{{page_number}}</a> </li>
            {% endifequal %}
        {% endfor %}
        {% if has_next %}
            <li> <a href="{{shop_base}}/?page={{next}}">Next</a></li>
        {% else %}
            <li> Next </li>
        {% endif %}
    </ul>
    </div>
    {% endif %}

{% endblock %}